use pydeco::deco;

fn logging<F>(func: F) -> impl Fn(i32, i32) -> i32
where
    F: Fn(i32, i32) -> i32,
{
    move |x, y| {
        println!("num1 = {}, num2 = {}", x, y);
        let out = func(x, y);
        println!("Output = {}", out);
        out
    }
}

// #[deco(logging)]
// fn add2(x: i32) -> i32 {
//     x + 2
// }

#[deco(logging)]
fn add(x: i32, y: i32) -> i32 {
    x + y
}

fn main() {
    add(2, 6);
    // let add_exp = logging(add);
    // add_exp(2, 6);
}
